package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.kaishengit.pojo.Atmessage;
import com.kaishengit.pojo.Project;
import com.kaishengit.pojo.User;

@Repository
public class AtmessageDao extends BaseDao<Atmessage,Integer>{

	@SuppressWarnings("unchecked")
	public List<Atmessage> findByProjAndUser(User user, Project project) {
		Query query = getSession().createQuery("from Atmessage where user=:user and project=:project order by id desc");
		query.setParameter("user", user);
		query.setParameter("project", project);
		return query.list();
	}

}
